class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: G = None
        self.u: E = None
        self.z: C = None
        self.q: E = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: D = None
        self.y: D = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: C = None
        self.q: G = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

l = A("l")
c = B("c")
n = C("n")
e = D("e")
j = E("j")
m = F("m")
k = G("k")
f = A("f")

l.y = c
l.t = f
c.u = m
c.r = e
n.o = e
n.r = k
e.o = n
e.z = n
e.t = k
e.u = j
e.q = j
e.x = j
e.y = j
j.s = k
j.p = k
j.x = e
j.y = e
m.x = j
m.z = j
m.u = j
m.p = n
m.q = k
k.t = j
f.y = c
f.t = l
assert j.p.t.y.t.t.y.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: G = None
        self.u: E = None
        self.z: C = None
        self.q: E = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: D = None
        self.y: D = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: C = None
        self.q: G = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

l = A("l")
c = B("c")
n = C("n")
e = D("e")
j = E("j")
m = F("m")
k = G("k")
f = A("f")

l.y = c
l.t = f
c.u = m
c.r = e
n.o = e
n.r = k
e.o = n
e.z = n
e.t = k
e.u = j
e.q = j
e.x = j
e.y = j
j.s = k
j.p = k
j.x = e
j.y = e
m.x = j
m.z = j
m.u = j
m.p = n
m.q = k
k.t = j
f.y = c
f.t = l
assert j.p.t.y.t.t.y.t.t.txt == "j"