class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: E = None
        self.p: E = None
        self.u: A = None
        self.v: C = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.s: A = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

b.q = c
b.x = a
h.x = k
h.v = k
h.r = c
h.p = c
h.u = b
h.z = a
k.u = a
k.r = c
a.v = b
a.y = e
a.w = e
c.p = e
c.t = h
c.w = h
c.s = b
c.z = b
e.p = b
e.z = h
e.x = h
e.t = k
e.u = a
j.v = k
assert c.p.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: E = None
        self.p: E = None
        self.u: A = None
        self.v: C = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: B = None
        self.s: A = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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