class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: G = None
        self.p: D = None
        self.z: B = None
        self.s: H = None
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.t: H = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.o: H = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.x: A = None
        self.z: D = None
        self.q: E = None
        self.txt = txt

c = A("c")
f = B("f")
g = C("g")
a = D("a")
n = E("n")
e = F("e")
i = G("i")
j = H("j")

c.r = n
c.y = i
c.p = a
c.z = f
c.s = j
c.w = e
f.q = n
g.z = n
a.r = g
n.u = i
e.s = g
e.o = c
e.t = j
e.x = i
i.w = n
i.t = n
i.u = c
i.o = j
j.o = f
j.p = c
j.x = c
j.z = a
j.q = n
assert i.u.w.o.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: G = None
        self.p: D = None
        self.z: B = None
        self.s: H = None
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.t: H = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: A = None
        self.o: H = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.x: A = None
        self.z: D = None
        self.q: E = None
        self.txt = txt

c = A("c")
f = B("f")
g = C("g")
a = D("a")
n = E("n")
e = F("e")
i = G("i")
j = H("j")

c.r = n
c.y = i
c.p = a
c.z = f
c.s = j
c.w = e
f.q = n
g.z = n
a.r = g
n.u = i
e.s = g
e.o = c
e.t = j
e.x = i
i.w = n
i.t = n
i.u = c
i.o = j
j.o = f
j.p = c
j.x = c
j.z = a
j.q = n
assert i.u.w.o.p.r.txt == "g"