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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: C = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: A = None
        self.r: C = None
        self.v: A = None
        self.w: G = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.t: D = None
        self.z: C = None
        self.o: A = None
        self.txt = txt

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

j.q = e
j.u = e
j.y = e
j.v = h
j.p = h
j.x = c
f.w = m
f.y = c
f.o = e
c.t = f
l.y = c
l.r = c
l.z = c
l.p = j
l.v = j
l.w = e
h.q = f
m.o = h
m.r = j
m.x = j
e.u = f
e.p = j
e.o = j
e.t = l
e.z = c
assert l.v.v.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: G = None
        self.v: E = None
        self.y: G = None
        self.p: E = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: C = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: A = None
        self.r: C = None
        self.v: A = None
        self.w: G = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.t: D = None
        self.z: C = None
        self.o: A = None
        self.txt = txt

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

j.q = e
j.u = e
j.y = e
j.v = h
j.p = h
j.x = c
f.w = m
f.y = c
f.o = e
c.t = f
l.y = c
l.r = c
l.z = c
l.p = j
l.v = j
l.w = e
h.q = f
m.o = h
m.r = j
m.x = j
e.u = f
e.p = j
e.o = j
e.t = l
e.z = c
assert l.v.v.q.o.txt == "e"