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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.z: E = None
        self.w: G = None
        self.s: G = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
b = B("b")
c = C("c")
g = D("g")
n = E("n")
l = F("l")
m = G("m")
a = G("a")
d = E("d")
f = D("f")

h.u = c
h.x = f
b.y = h
b.x = f
b.z = n
b.w = m
b.s = a
b.r = c
b.t = d
c.r = n
c.u = f
c.v = m
c.x = h
g.o = b
g.r = d
g.x = l
n.q = c
n.r = c
l.r = g
m.s = n
a.s = d
d.q = c
d.r = c
f.o = b
f.r = n
f.x = l
assert c.v.s.r.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.z: E = None
        self.w: G = None
        self.s: G = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
b = B("b")
c = C("c")
g = D("g")
n = E("n")
l = F("l")
m = G("m")
a = G("a")
d = E("d")
f = D("f")

h.u = c
h.x = f
b.y = h
b.x = f
b.z = n
b.w = m
b.s = a
b.r = c
b.t = d
c.r = n
c.u = f
c.v = m
c.x = h
g.o = b
g.r = d
g.x = l
n.q = c
n.r = c
l.r = g
m.s = n
a.s = d
d.q = c
d.r = c
f.o = b
f.r = n
f.x = l
assert c.v.s.r.u.x.txt == "l"