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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.z: C = None
        self.q: D = None
        self.r: A = None
        self.o: E = None
        self.x: C = None
        self.txt = txt

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

d = A("d")
h = B("h")
i = C("i")
n = D("n")
g = E("g")
c = F("c")
a = G("a")
j = C("j")

d.w = n
d.x = n
h.w = g
h.v = d
i.x = j
i.t = d
n.r = h
g.y = c
c.w = d
c.r = d
c.p = n
c.q = n
c.z = i
c.x = i
c.o = g
a.o = c
a.q = c
a.t = g
a.u = d
a.w = h
a.v = n
j.x = i
j.t = d
assert c.r.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.z: C = None
        self.q: D = None
        self.r: A = None
        self.o: E = None
        self.x: C = None
        self.txt = txt

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

d = A("d")
h = B("h")
i = C("i")
n = D("n")
g = E("g")
c = F("c")
a = G("a")
j = C("j")

d.w = n
d.x = n
h.w = g
h.v = d
i.x = j
i.t = d
n.r = h
g.y = c
c.w = d
c.r = d
c.p = n
c.q = n
c.z = i
c.x = i
c.o = g
a.o = c
a.q = c
a.t = g
a.u = d
a.w = h
a.v = n
j.x = i
j.t = d
assert c.r.x.r.txt == "h"