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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: G = None
        self.w: D = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.w: G = None
        self.v: F = None
        self.t: E = None
        self.q: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: G = None
        self.w: D = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.w: G = None
        self.v: F = None
        self.t: E = None
        self.q: E = None
        self.s: F = None
        self.txt = txt

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

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