class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: G = None
        self.w: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.x: E = None
        self.z: G = None
        self.v: G = None
        self.p: D = None
        self.u: G = None
        self.txt = txt

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

b = A("b")
g = B("g")
d = C("d")
k = D("k")
i = E("i")
e = F("e")
a = G("a")
m = B("m")
c = C("c")

b.r = d
b.p = e
b.t = i
g.p = e
g.x = a
g.w = k
d.w = e
d.r = i
k.u = a
k.z = i
i.x = e
i.p = a
i.r = a
i.o = k
e.y = k
e.s = k
e.p = k
e.x = i
e.z = a
e.v = a
e.u = a
a.w = b
m.p = e
m.x = a
m.w = k
c.w = e
c.r = i
assert e.u.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: G = None
        self.w: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.x: E = None
        self.z: G = None
        self.v: G = None
        self.p: D = None
        self.u: G = None
        self.txt = txt

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

b = A("b")
g = B("g")
d = C("d")
k = D("k")
i = E("i")
e = F("e")
a = G("a")
m = B("m")
c = C("c")

b.r = d
b.p = e
b.t = i
g.p = e
g.x = a
g.w = k
d.w = e
d.r = i
k.u = a
k.z = i
i.x = e
i.p = a
i.r = a
i.o = k
e.y = k
e.s = k
e.p = k
e.x = i
e.z = a
e.v = a
e.u = a
a.w = b
m.p = e
m.x = a
m.w = k
c.w = e
c.r = i
assert e.u.w.r.txt == "d"